#ifndef __OSD_H__
#define __OSD_H__

#define SFLASH_IMG_ADDR				0x200000

#define WIN0					0
#define WIN1					1
#define WIN2					2
#define WIN3					3
#define WIN4					4
#define WIN5					5
#define WIN6					6
#define WIN7					7
#define WIN8					8

typedef struct{
	BYTE type;
	WORD offset;
	DWORD addr;
	WORD startx;
	WORD starty;
	WORD width;
	WORD height;
	BYTE RLCdata;
} IMAGEINFO;


extern code IMAGEINFO imgMiddle;
extern code IMAGEINFO imgLeft;
extern code IMAGEINFO imgRight;
extern IMAGEINFO curr_img;

void WaitVBlank(BYTE cnt);
BYTE McuSpiClkToPclk(BYTE divider);
void McuSpiClkRestore(void);
void SpiOsdSetDeValue(void);
void SpiOsdEnable(BYTE en);
void OsdWinEnable(BYTE win, BYTE en);
void SpiOsdLoadLUT(BYTE type, WORD LutOffset, WORD size, DWORD address);
void LoadMenu(BYTE win,DWORD addr,WORD startx,WORD starty,WORD width,WORD height,BYTE RLCdata);
void LoadMenu2(BYTE win,DWORD addr);
void LoadBackViewParkingGird(void);
void Drawdongtaiguiji(void);

#endif